package com.bajiao.service.order;

import com.bajiao.entity.order.Order;
import com.bajiao.entity.order.RefundOrder;
import com.bajiao.vo.order.RefundOrderAdmin;
import com.baomidou.mybatisplus.extension.service.IService;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @Description: 退款单
 * @Author: FanJq
 * @Date:   2024-12-14
 * @Version: V1.0
 */
public interface RefundOrderService extends IService<RefundOrder> {

    /**
     * @Description
     * 创建退款单
     * @date 2024/12/19 11:47
     * @author FanJq
     * @param order
     * @return {@link RefundOrder}
    */
    RefundOrder create(Order order, String reason);

    /**
     * @Description
     * 根据主订单编号获取
     * @date 2024/12/19 16:59
     * @author FanJq
     * @param orderNo
     * @return {@link RefundOrder}
    */
    RefundOrder getByOrderNo(String orderNo);

    /**
     * @Description
     * 退款单审批
     * @date 2024/12/19 17:11
     * @author FanJq
     * @param refundOrder
     * @param status
     * @return
    */
    void approve(RefundOrder refundOrder, int status);

    /**
     * @Description
     * 管理后台列表
     * @date 2025/1/8 16:02
     * @author FanJq
     * @param orderNo
     * @param keywords
     * @param productTitle
     * @param status
     * @param createTimeBegin
     * @param createTimeEnd
     * @return {@link List< RefundOrderAdmin>}
    */
    List<RefundOrderAdmin> getAdminList(String orderNo, String keywords, String productTitle, Integer status, String createTimeBegin, String createTimeEnd);

    /**
     * @Description
     * 微信退款通知
     * @date 2025/1/13 20:26
     * @author FanJq
     * @param request
     * @return
    */
    void refundNotify(HttpServletRequest request);
}
